Skip to content

fix(a2a): map Event.output into to_a2a artifacts - #6777

Open
a2105z wants to merge 1 commit into
google:mainfrom
a2105z:fix/a2a-workflow-output-schema
Open

fix(a2a): map Event.output into to_a2a artifacts#6777
a2105z wants to merge 1 commit into
google:mainfrom
a2105z:fix/a2a-workflow-output-schema

Conversation

@a2105z

@a2105z a2105z commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When an ADK event has structured Event.output and no content parts (the shape Workflow output_schema finals use), A2A converters now serialize that output into DataParts instead of dropping it
  • Both the legacy event_converter path (used by to_a2a()) and the newer from_adk_event path are updated
  • Content is still preferred when present so finish_task function-call parts keep their metadata

Fixes #6762

Root cause

to_a2a() builds the final artifact from converted ADK events. Converters only read event.content.parts. A Workflow with output_schema finishes by flushing Event(output=<validated model>) with empty content, so the structured result never entered A2A — only earlier agent text (often the last str node) remained in result.artifacts.

Test plan

  • pytest tests/unittests/a2a/converters/test_from_adk.py tests/unittests/a2a/converters/test_event_converter.py tests/unittests/a2a/executor/test_a2a_agent_executor.py
  • Manual repro: agent text events then Event(output=Report(...)) → TaskResultAggregator final parts are the Report DataPart
  • Reviewer: confirm finish_task / content-bearing events still convert via content parts

@google-cla

google-cla Bot commented Aug 17, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@a2105z
a2105z force-pushed the fix/a2a-workflow-output-schema branch 2 times, most recently from 35e3efd to 5712367 Compare August 17, 2026 20:00
Workflow output_schema finals are emitted as Event(output=...) with no
content parts. A2A converters previously ignored output, so the final
artifact kept only the last agent node's text. Serialize output into
DataParts when content is absent (preserving finish_task content).

Fixes google#6762
@a2105z
a2105z force-pushed the fix/a2a-workflow-output-schema branch from 5712367 to 366b518 Compare August 17, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflow output_schema is dropped when exposed via to_a2a(); artifact contains only the last agent node's text output

2 participants